<html>

<head>
    <meta charset="utf-8">
    <title>table模块快速使用</title>
    <link rel="stylesheet" href="./layui/css/layui.css" media="all">
</head>
<div id="pTable" style="width: 1200px;">
    <table class="layui-table" id="layui_table_id" lay-filter="test">
    </table>
    <div id="laypage"></div>
</div>

<body>

<script src="./layui/layui.js"></script>
<script>
    layui.use(['table','laypage','laydate'], function(){
        var table = layui.table,
            laydate=layui.laydate,
            laypage = layui.laypage;
        table.render({
            elem: '#layui_table_id'
            , url: '<%=path%>/xx/pListQuery.html?pId='+productGroupId+'¤tPage='+ start+'¤tNumber=' + limitsize
            /*, where:{pagename:start,pagelimit:limitsize} //传参*/
            , cols: [

                [
                {field: 'productId', title: 'ID', width: '170', sort: true}
                , {field: 'productName', title: '名称', width: '450'}
                , {field: 'productState', title: '状态', width: '100'}
                , {field: 'effectTime', title: '生效时间', width: '120', sort: true}
                , {field: 'invalidTime', title: '失效时间', width: '120', sort: true}
                , {field: 'productCost', title: '成本', width: '100', sort: true}
                , {field: 'poperation', title: '操作', width: '100',fixed: 'right', toolbar: '#barDemo'}
            ]

            ]
            , page: false
            , height: 430
            ,done: function(res, curr, count){
                //如果是异步请求数据方式，res即为你接口返回的信息。
                //如果是直接赋值的方式，res即为：{data: [], count: 99} data为当前页数据、count为数据总长度
                laypage.render({
                    elem:'laypage'
                    ,count:count
                    ,curr:curnum
                    ,limit:limitcount
                    ,layout: ['prev', 'page', 'next', 'skip','count','limit']
                    ,jump:function (obj,first) {
                        if(!first){
                            curnum = obj.curr;
                            limitcount = obj.limit;
                            //console.log("curnum"+curnum);
                            //console.log("limitcount"+limitcount);
                            //layer.msg(curnum+"-"+limitcount);
                            productsearch(productGroupId,curnum,limitcount);
                        }
                    }
                })
            }
        })

</script>
</body>

</html>